import Vue from "vue";
import Router from "vue-router";

// 引入排行榜插件
import sort from "./pages/cjs/sort/sort.vue";
import All from "./pages/cjs/sort/right/all.vue";

import Login from "@/pages/wl/Login.vue";

import kehuduan from "./pages/hm/kehuduan.vue";
import mybook from "./pages/hm/mybook.vue";
import amazing from "./pages/hm/amazing.vue";
import benzhou from "./components/hm/benzhou.vue";
import junshi from "./components/hm/junshi.vue";
import lishi from "./components/hm/lishi.vue";
import nvsheng from "./components/hm/nvsheng.vue";
import nanpin from "./components/hm/nanpin.vue";
import nvpin from "./components/hm/nvpin.vue";

import classify from "./pages/wwj/classify.vue";
import male from "./components/wwj/male.vue";
import female from "./components/wwj/female.vue";
import publication from "./components/wwj/publication.vue";

import Home from "./pages/wzy";
import Bookdetails from "./components/lh/bookdetails.vue";

import Header from "./components/wzy/header.vue";

import Search from "@/pages/wl/Search.vue";


// 引入小说章节
import readybooks from "./pages/cjs/readybooks/zhangjie.vue"
// 引入图片
import Page404 from "./pages/Page404.vue"


Vue.use(Router);

export default new Router({
    routes: [{
            path: "/login",
            component: Login
        },
        {
            path: "/",
            name: "header",
            component: Header,
            children: [{
                    path: "4",
                    component: sort,
                    children: [{
                        path: "all",
                        component: All
                    }]
                },
                {
                    path: "bookdetails",
                    name: "bookdetails",
                    component: Bookdetails
                },
                {
                    path: "/4",
                    redirect: "/4/all"
                },
                {
                    path: "/",
                    redirect: "homepage"
                },
                {
                    path: "homepage",
                    component: Home
                },
                {
                    path: "search",
                    name: "search",
                    component: Search
                },
                {
                    path: "/3",
                    name: "classify",
                    component: classify,
                    children: [{
                            path: "male",
                            name: "male",
                            component: male
                        },
                        {
                            path: "female",
                            name: "female",
                            component: female
                        },
                        {
                            path: "publication",
                            name: "publication",
                            component: publication
                        },
                        {
                            path: "/3",
                            redirect: "male"
                        }
                    ]
                },
                {
                    path: "amazing",
                    name: "amazing",
                    component: amazing,
                    children: [{
                            path: "benzhou",
                            name: "benzhou",
                            component: benzhou
                        },
                        {
                            path: "junshi",
                            name: "junshi",
                            component: junshi
                        },
                        {
                            path: "lishi",
                            name: "lishi",
                            component: lishi
                        },
                        {
                            path: "nvsheng",
                            name: "nvsheng",
                            component: nvsheng
                        },
                        {
                            path: "nanpin",
                            name: "nanpin",
                            component: nanpin
                        },
                        {
                            path: "nvpin",
                            name: "nvpin",
                            component: nvpin
                        },
                        {
                            path: "/amazing",
                            redirect: "benzhou"
                        }
                    ]
                },
                {
                    path: "/kehuduan",
                    name: "kehuduan",
                    component: kehuduan
                },
                {
                    path: "/mybook",
                    name: "mybook",
                    component: mybook
                }
            ]
        },
        {
            path: "/bookdetails",
            name: "bookdetails",
            component: Bookdetails

        },
        {
            path: "/readybooks",
            component: readybooks
        },
        {
            path:"*",
            component:Page404
        }
    ]
});